async function post(url: string, data: any) {
    url = "https://netease-cloud-music-api-binaryify-git-fork-blo-45af1f-binaryify.vercel.app/" + url
    // Default options are marked with *
    const response = await fetch(url, {
        body: JSON.stringify(data),
        cache: 'no-cache',
        credentials: 'same-origin',
        headers: {
            'user-agent': 'Mozilla/4.0 MDN Example',
            'content-type': 'application/json'
        },
        method: 'POST',
        mode: 'cors',
        redirect: 'follow',
        referrer: 'no-referrer', // *client, no-referrer
    })
    return await response.json() // parses response to JSON
}

async function get(url: string) {
    url = "https://netease-cloud-music-api-binaryify-git-fork-blo-45af1f-binaryify.vercel.app/" + url
    // Default options are marked with *
    const response = await fetch(url, {
        body: null,
        cache: 'no-cache',
        credentials: 'same-origin',
        headers: {
            'user-agent': 'Mozilla/4.0 MDN Example',
            'content-type': 'application/json'
        },
        method: 'GET',
        mode: 'cors',
        redirect: 'follow',
        referrer: 'no-referrer', // *client, no-referrer
    })
    return await response.json() // parses response to JSON
}

export {
    post,
    get
};